package cl.golive.d2menu.pantallas;

import cl.golive.d2menu.bll.OBJPlato;
import cl.golive.d2menu.obj.Compra;
import cl.golive.d2menu.obj.Plato;
import cl.golive.d2menu.utils.modeloUtils.CompraTableModel;
import cl.golive.d2menu.utils.modeloUtils.PlatosTableModel;
import cl.golive.d2menu.utils.simulacionUtils.PlatoSimulado;
import cl.golive.d2menu.utils.tableUtils.AccionesTablaUtil;
import cl.golive.d2menu.utils.tableUtils.UtilesTabla;
import java.awt.Color;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.UIManager;

/**
 *
 * @author whyem
 */
public class PantallaPrincipalDedos extends javax.swing.JFrame {

    /** Creates new form vPrincipal */
    public PantallaPrincipalDedos() {
        setLaF();
        initComponents();
        initComponentesPersonalizados();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jSeparator3 = new javax.swing.JSeparator();
        botoneraCategorias = new javax.swing.JToolBar();
        botonEntradas = new javax.swing.JButton();
        botonPlatosFondo = new javax.swing.JButton();
        botonPostres = new javax.swing.JButton();
        botonOtros = new javax.swing.JButton();
        botonBebidas = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        pnlLogo = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        pnlCompra = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        grillaCompra = new javax.swing.JTable();
        jPanel12 = new javax.swing.JPanel();
        botoneraCompra = new javax.swing.JToolBar();
        botonGenerarPedido = new javax.swing.JButton();
        botonQuitarPlato = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        pnlNomRestaurante = new javax.swing.JPanel();
        lblImagen = new javax.swing.JLabel();
        pnlMenu = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        grillaMenu = new javax.swing.JTable();
        jPanel5 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        botoneraCentral = new javax.swing.JToolBar();
        botonAgregarPlato = new javax.swing.JButton();
        botonVerDetallePlato = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setExtendedState(6);
        setMinimumSize(new java.awt.Dimension(500, 300));

        jPanel1.setBackground(new java.awt.Color(0, 0, 0));
        jPanel1.setLayout(new java.awt.BorderLayout());

        jPanel2.setBackground(new java.awt.Color(0, 0, 0));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel2.setMinimumSize(new java.awt.Dimension(250, 1014));
        jPanel2.setPreferredSize(new java.awt.Dimension(140, 361));
        jPanel2.setLayout(new java.awt.BorderLayout());
        jPanel2.add(jSeparator3, java.awt.BorderLayout.PAGE_END);

        botoneraCategorias.setBackground(new java.awt.Color(0, 0, 0));
        botoneraCategorias.setFloatable(false);
        botoneraCategorias.setOrientation(1);
        botoneraCategorias.setRollover(true);

        botonEntradas.setBackground(new java.awt.Color(0, 0, 0));
        botonEntradas.setForeground(new java.awt.Color(255, 255, 255));
        botonEntradas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_Entrada.png"))); // NOI18N
        botonEntradas.setText("Entradas");
        botonEntradas.setFocusable(false);
        botonEntradas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonEntradas.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonEntradas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonEntradasActionPerformed(evt);
            }
        });
        botoneraCategorias.add(botonEntradas);

        botonPlatosFondo.setBackground(new java.awt.Color(0, 0, 0));
        botonPlatosFondo.setForeground(new java.awt.Color(255, 255, 255));
        botonPlatosFondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_pFondo.png"))); // NOI18N
        botonPlatosFondo.setText("Platos de Fondo");
        botonPlatosFondo.setFocusable(false);
        botonPlatosFondo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonPlatosFondo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonPlatosFondo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonPlatosFondoActionPerformed(evt);
            }
        });
        botoneraCategorias.add(botonPlatosFondo);

        botonPostres.setBackground(new java.awt.Color(0, 0, 0));
        botonPostres.setForeground(new java.awt.Color(255, 255, 255));
        botonPostres.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_Postre.png"))); // NOI18N
        botonPostres.setText("Postres");
        botonPostres.setFocusable(false);
        botonPostres.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonPostres.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonPostres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonPostresActionPerformed(evt);
            }
        });
        botoneraCategorias.add(botonPostres);

        botonOtros.setBackground(new java.awt.Color(0, 0, 0));
        botonOtros.setForeground(new java.awt.Color(255, 255, 255));
        botonOtros.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_otros.png"))); // NOI18N
        botonOtros.setText("Acompañamientos");
        botonOtros.setFocusable(false);
        botonOtros.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonOtros.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonOtros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonOtrosActionPerformed(evt);
            }
        });
        botoneraCategorias.add(botonOtros);

        botonBebidas.setBackground(new java.awt.Color(0, 0, 0));
        botonBebidas.setForeground(new java.awt.Color(255, 255, 255));
        botonBebidas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_bebidas.png"))); // NOI18N
        botonBebidas.setText("Jugos y Bebidas");
        botonBebidas.setFocusable(false);
        botonBebidas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonBebidas.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonBebidas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonBebidasActionPerformed(evt);
            }
        });
        botoneraCategorias.add(botonBebidas);

        jPanel2.add(botoneraCategorias, java.awt.BorderLayout.CENTER);

        jPanel1.add(jPanel2, java.awt.BorderLayout.LINE_END);

        jPanel3.setBackground(new java.awt.Color(0, 0, 0));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel3.setMinimumSize(new java.awt.Dimension(380, 333));
        jPanel3.setPreferredSize(new java.awt.Dimension(365, 428));
        jPanel3.setLayout(new java.awt.BorderLayout());

        pnlLogo.setBackground(new java.awt.Color(0, 0, 0));
        pnlLogo.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        pnlLogo.setPreferredSize(new java.awt.Dimension(130, 162));
        pnlLogo.setLayout(new java.awt.BorderLayout());

        jLabel1.setBackground(new java.awt.Color(0, 0, 0));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/logo_d2menu.png"))); // NOI18N
        jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        pnlLogo.add(jLabel1, java.awt.BorderLayout.CENTER);

        jPanel3.add(pnlLogo, java.awt.BorderLayout.NORTH);

        pnlCompra.setBackground(new java.awt.Color(0, 0, 0));
        pnlCompra.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Lista de Compra", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(255, 255, 255))); // NOI18N
        pnlCompra.setPreferredSize(new java.awt.Dimension(130, 162));
        pnlCompra.setLayout(new java.awt.BorderLayout());

        jScrollPane2.setBackground(new java.awt.Color(0, 0, 0));

        grillaCompra.setFont(new java.awt.Font("Arial Narrow", 1, 16));
        grillaCompra.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null}
            },
            new String [] {
                "Plato", "Precio"
            }
        ));
        grillaCompra.setRowHeight(30);
        grillaCompra.setSelectionBackground(new java.awt.Color(255, 255, 204));
        grillaCompra.setSelectionForeground(new java.awt.Color(0, 0, 0));
        grillaCompra.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                registroSeleccionadoCompra(evt);
            }
        });
        jScrollPane2.setViewportView(grillaCompra);

        pnlCompra.add(jScrollPane2, java.awt.BorderLayout.CENTER);

        jPanel12.setBackground(new java.awt.Color(0, 0, 0));
        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel12.setLayout(new java.awt.BorderLayout());

        botoneraCompra.setBackground(new java.awt.Color(0, 0, 0));
        botoneraCompra.setFloatable(false);
        botoneraCompra.setRollover(true);

        botonGenerarPedido.setBackground(new java.awt.Color(0, 0, 0));
        botonGenerarPedido.setForeground(new java.awt.Color(255, 255, 255));
        botonGenerarPedido.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_compra.png"))); // NOI18N
        botonGenerarPedido.setText("Generar pedido");
        botonGenerarPedido.setFocusable(false);
        botonGenerarPedido.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonGenerarPedido.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonGenerarPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonGenerarPedidoActionPerformed(evt);
            }
        });
        botoneraCompra.add(botonGenerarPedido);

        botonQuitarPlato.setBackground(new java.awt.Color(0, 0, 0));
        botonQuitarPlato.setForeground(new java.awt.Color(255, 255, 255));
        botonQuitarPlato.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_eliminar.png"))); // NOI18N
        botonQuitarPlato.setText("Quitar del pedido");
        botonQuitarPlato.setFocusable(false);
        botonQuitarPlato.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonQuitarPlato.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonQuitarPlato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonQuitarPlatoActionPerformed(evt);
            }
        });
        botoneraCompra.add(botonQuitarPlato);

        jPanel12.add(botoneraCompra, java.awt.BorderLayout.CENTER);

        pnlCompra.add(jPanel12, java.awt.BorderLayout.PAGE_END);

        jPanel3.add(pnlCompra, java.awt.BorderLayout.CENTER);

        jPanel1.add(jPanel3, java.awt.BorderLayout.LINE_START);

        jPanel4.setBackground(new java.awt.Color(0, 0, 0));
        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel4.setLayout(new java.awt.BorderLayout());

        pnlNomRestaurante.setBackground(new java.awt.Color(0, 0, 0));
        pnlNomRestaurante.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        pnlNomRestaurante.setPreferredSize(new java.awt.Dimension(305, 162));
        pnlNomRestaurante.setLayout(new java.awt.BorderLayout());

        lblImagen.setBackground(new java.awt.Color(0, 0, 0));
        lblImagen.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblImagen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/restaurante_logo/logo_restaurante.jpg"))); // NOI18N
        pnlNomRestaurante.add(lblImagen, java.awt.BorderLayout.CENTER);

        jPanel4.add(pnlNomRestaurante, java.awt.BorderLayout.NORTH);

        pnlMenu.setBackground(new java.awt.Color(0, 0, 0));
        pnlMenu.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Lista de Platos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(255, 255, 255))); // NOI18N
        pnlMenu.setPreferredSize(new java.awt.Dimension(305, 162));
        pnlMenu.setLayout(new java.awt.BorderLayout());

        jScrollPane1.setBackground(new java.awt.Color(0, 0, 0));
        jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

        grillaMenu.setFont(new java.awt.Font("Arial Narrow", 1, 16)); // NOI18N
        grillaMenu.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null}
            },
            new String [] {
                "Nombre Plato", "Precio"
            }
        ));
        grillaMenu.setRowHeight(30);
        grillaMenu.setSelectionBackground(new java.awt.Color(255, 255, 204));
        grillaMenu.setSelectionForeground(new java.awt.Color(0, 0, 0));
        grillaMenu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                registroSeleccionadoMenu(evt);
            }
        });
        jScrollPane1.setViewportView(grillaMenu);

        pnlMenu.add(jScrollPane1, java.awt.BorderLayout.CENTER);

        jPanel5.setBackground(new java.awt.Color(0, 0, 0));
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel5.setLayout(new java.awt.GridLayout(1, 7));

        jPanel8.setBackground(new java.awt.Color(0, 0, 0));
        jPanel8.setLayout(new java.awt.BorderLayout());

        botoneraCentral.setBackground(new java.awt.Color(0, 0, 0));
        botoneraCentral.setFloatable(false);
        botoneraCentral.setRollover(true);

        botonAgregarPlato.setBackground(new java.awt.Color(0, 0, 0));
        botonAgregarPlato.setForeground(new java.awt.Color(255, 255, 255));
        botonAgregarPlato.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_agregar.png"))); // NOI18N
        botonAgregarPlato.setText("Agregar al pedido");
        botonAgregarPlato.setFocusable(false);
        botonAgregarPlato.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonAgregarPlato.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonAgregarPlato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAgregarPlatoActionPerformed(evt);
            }
        });
        botoneraCentral.add(botonAgregarPlato);

        botonVerDetallePlato.setBackground(new java.awt.Color(0, 0, 0));
        botonVerDetallePlato.setForeground(new java.awt.Color(255, 255, 255));
        botonVerDetallePlato.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/imagenesApp/B_detalle.png"))); // NOI18N
        botonVerDetallePlato.setText("Ver detalle de plato");
        botonVerDetallePlato.setFocusable(false);
        botonVerDetallePlato.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botonVerDetallePlato.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botonVerDetallePlato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonVerDetallePlatoActionPerformed(evt);
            }
        });
        botoneraCentral.add(botonVerDetallePlato);

        jPanel8.add(botoneraCentral, java.awt.BorderLayout.CENTER);

        jPanel5.add(jPanel8);

        pnlMenu.add(jPanel5, java.awt.BorderLayout.PAGE_END);

        jPanel4.add(pnlMenu, java.awt.BorderLayout.CENTER);

        jPanel1.add(jPanel4, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-2006)/2, (screenSize.height-1049)/2, 2006, 1049);
    }// </editor-fold>//GEN-END:initComponents

    private void registroSeleccionadoMenu(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_registroSeleccionadoMenu
        
    }//GEN-LAST:event_registroSeleccionadoMenu

    private void registroSeleccionadoCompra(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_registroSeleccionadoCompra
         // TODO add your handling code here:
    }//GEN-LAST:event_registroSeleccionadoCompra

    private void botonEntradasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonEntradasActionPerformed
        desplegarCategoria(1);
    }//GEN-LAST:event_botonEntradasActionPerformed

    private void botonPlatosFondoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonPlatosFondoActionPerformed
        desplegarCategoria(2);
    }//GEN-LAST:event_botonPlatosFondoActionPerformed

    private void botonPostresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonPostresActionPerformed
        desplegarCategoria(3);
    }//GEN-LAST:event_botonPostresActionPerformed

    private void botonOtrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonOtrosActionPerformed
        desplegarCategoria(4);
    }//GEN-LAST:event_botonOtrosActionPerformed

    private void botonBebidasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonBebidasActionPerformed
        desplegarCategoria(5);
    }//GEN-LAST:event_botonBebidasActionPerformed

    private void botonVerDetallePlatoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonVerDetallePlatoActionPerformed
        Plato platoSeleccionadoMenu = AccionesTablaUtil.obtenerPlatoSeleccionadoMenu(getGrillaMenu());
        if(platoSeleccionadoMenu != null) {
            new PantallaVerPlato(this, true, platoSeleccionadoMenu).setVisible(true);
            //new PantallaVerPlato_(this, true, platoSeleccionadoMenu).setVisible(true);
        }
    }//GEN-LAST:event_botonVerDetallePlatoActionPerformed

    private void botonAgregarPlatoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAgregarPlatoActionPerformed
        Plato platoSeleccionadoMenu = AccionesTablaUtil.obtenerPlatoSeleccionadoMenu(getGrillaMenu());
        if(platoSeleccionadoMenu != null) {
            AccionesTablaUtil.agregarPlatoAListaPedido(getGrillaCompra(),platoSeleccionadoMenu);
        }
    }//GEN-LAST:event_botonAgregarPlatoActionPerformed

    private void botonQuitarPlatoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonQuitarPlatoActionPerformed
        Compra platoCompra = AccionesTablaUtil.obtenerPlatoSeleccionadoCompra(getGrillaCompra());
        if(platoCompra != null) {
           AccionesTablaUtil.quitarPlatoDeListaPedido(getGrillaCompra(),platoCompra);
        }
    }//GEN-LAST:event_botonQuitarPlatoActionPerformed

    private void botonGenerarPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonGenerarPedidoActionPerformed
        CompraTableModel modelo = (CompraTableModel) getGrillaCompra().getModel();
         if(modelo != null) {
            new PantallaResumenCompra(this, true, modelo).setVisible(true);
            //new PantallaResumenCompra_(this, true, modelo).setVisible(true);
        }
    }//GEN-LAST:event_botonGenerarPedidoActionPerformed

    private void desplegarCategoria(int categoriaId) {
       List<Plato> listaDePlatos = new ArrayList<Plato>();

        try {
            OBJPlato oPlato = new OBJPlato();
            listaDePlatos=oPlato.traerPlatosPorCategoria(categoriaId);
        } catch (ClassNotFoundException ex) {
            System.out.println("classClassNotFoundExceptionnotfound"+ex.getMessage());
        } catch (InstantiationException ex) {
           System.out.println("InstantiationException"+ex.getMessage());
        } catch (IllegalAccessException ex) {
            System.out.println("IllegalAccessException"+ex.getMessage());
        } catch (IOException ex) {
            System.out.println("IOException"+ex.getMessage());
        } catch (SQLException ex) {
            System.out.println("SQLException"+ex.getMessage());
        }
        //List<Plato> listaDePlatos = simularBusqueda(categoriaId);
        PlatosTableModel modelo = new PlatosTableModel();

        modelo.setColumnIdentifiers(new String[] {"PlatoId", "CategoriaId", "Nombre de Plato", "Detalle", "Precio", "NombreImagen"});

        for(Plato plato : listaDePlatos) {
            modelo.addCustomRowPlato(plato);
        }

        getGrillaMenu().setModel(modelo);
        //SE OCULTAN TODOS LAS COLUMNAS QUE NO SEAN: NOMBRE DE PLATO (2) Y PRECIO (4)
        UtilesTabla.setOcultarColumnasJTable(getGrillaMenu(), new int[]{0,1,3,5});
        UtilesTabla.setAnchoOptimoGrillaMenu(getGrillaMenu());
    }

    private List<Plato> simularBusqueda(int categoriaId) {
        List<Plato> platosList = new ArrayList();

        if(categoriaId==1){platosList = PlatoSimulado.getEntradas();}
        if(categoriaId==2){platosList = PlatoSimulado.getFondo();}
        if(categoriaId==3){platosList = PlatoSimulado.getPostres();}
        if(categoriaId==4){platosList = PlatoSimulado.getOtros();}
        if(categoriaId==5){platosList = PlatoSimulado.getBebidas();}

        return platosList;
    }

     private List<Plato> simularBusquedaDos(int categoriaId) {
        List<Plato> platosList = new ArrayList();

        for(int i=1;i<6;i++) {
            Plato oPlato = new Plato();
            oPlato.setCategoriaId(categoriaId);
            oPlato.setNombrePlato("Sopa "+i);
            oPlato.setPrecio(3000+i*10);
            oPlato.setPlatoId(i);
            oPlato.setDetallePlato("Sopa de pollo "+i);
            platosList.add(oPlato);
        }

        return platosList;
    }

    private void initComponentesPersonalizados() {
        // DEJANDO EL BACKGROUND DEL SCROLLPANE (VIEWPORT) EN NEGRO
        jScrollPane2.getViewport().setBackground(Color.BLACK);
        jScrollPane1.getViewport().setBackground(Color.BLACK);
        //this.setUndecorated(true);
    }

    private void setLaF(){
        try{
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }catch (Exception e){
            System.out.println("Error: "+e.getMessage());
        }
        return;
    }   


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonAgregarPlato;
    private javax.swing.JButton botonBebidas;
    private javax.swing.JButton botonEntradas;
    private javax.swing.JButton botonGenerarPedido;
    private javax.swing.JButton botonOtros;
    private javax.swing.JButton botonPlatosFondo;
    private javax.swing.JButton botonPostres;
    private javax.swing.JButton botonQuitarPlato;
    private javax.swing.JButton botonVerDetallePlato;
    private javax.swing.JToolBar botoneraCategorias;
    private javax.swing.JToolBar botoneraCentral;
    private javax.swing.JToolBar botoneraCompra;
    private javax.swing.JTable grillaCompra;
    public javax.swing.JTable grillaMenu;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel12;
    protected javax.swing.JPanel jPanel2;
    protected javax.swing.JPanel jPanel3;
    protected javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel8;
    public javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JLabel lblImagen;
    protected javax.swing.JPanel pnlCompra;
    private javax.swing.JPanel pnlLogo;
    protected javax.swing.JPanel pnlMenu;
    protected javax.swing.JPanel pnlNomRestaurante;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the grillaCompra
     */
    public javax.swing.JTable getGrillaCompra() {
        return grillaCompra;
    }

    /**
     * @param grillaCompra the grillaCompra to set
     */
    public void setGrillaCompra(javax.swing.JTable grillaCompra) {
        this.grillaCompra = grillaCompra;
    }

    /**
     * @return the grillaMenu
     */
    public javax.swing.JTable getGrillaMenu() {
        return grillaMenu;
    }

    /**
     * @param grillaMenu the grillaMenu to set
     */
    public void setGrillaMenu(javax.swing.JTable grillaMenu) {
        this.grillaMenu = grillaMenu;
    }

}
